import java.util.Scanner;
public class Max {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int[] a = new int[10];
		for(int i=0;i<a.length;i++) {
			a[i] = reader.nextInt();
		}
		
		int temp = 0;
		int size = a.length;
		for(int i=0;i<size-1;i++) {
			for(int j=0;j<size-1-i;j++) {
				if(a[j] > a[j+1]) {
					temp = a[j];
					a[j] = a[j+1];
					a[j+1] = temp;
				}
			}
		}
		System.out.print("max="+a[a.length-1]+","+"cmax="+a[a.length-2]);
	}
}
	
